package training.hari.collections;

public class Name implements Comparable<Name> {

	private String name;
	
	public Name(String name){
		this.name = name;
	}
	@Override
	public int compareTo(Name other) {
		if(name != null && other.name !=null){
			return name.compareToIgnoreCase(other.name);
		}
		else{
			return -1;
		}
		
	}
	
	@Override
	public String toString() {
		return this.name;
	}

}
